package various;

import java.awt.Image;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;


public class Functions 
{
	
	public static Image angleRepaint(Image pic, int angle) throws IOException
	{
		
		AffineTransform tx = new AffineTransform();
		tx.rotate(Math.toRadians(angle), pic.getWidth(null) / 2, pic.getHeight(null) / 2);
		AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
		op = new AffineTransformOp(tx,AffineTransformOp.TYPE_BILINEAR);
		pic = op.filter((BufferedImage) pic, op.createCompatibleDestImage((BufferedImage) pic, null) );
		return pic;
	}

}
